package com.ashapo.pattern.pattern020state;

//第4步：使用Context查看状态更改时的行为更改。

public class StatePatternDemo {

    /**
     * 状态模式
     * @param args
     */
    public static void main(String[] args) {
        Context context = new Context();

        StartState startState = new StartState();
        startState.doAction(context);

        System.out.println(context.getState().toString());

        StopState stopState = new StopState();
        stopState.doAction(context);

        System.out.println(context.getState().toString());
    }
}
